package cn.gson.school.controller.jiuye;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.gson.school.dao.jiuye.InterviewExperienceEntityDao;
import cn.gson.school.entity.jiuye.InterviewExperienceEntity;
import cn.gson.school.mappers.jiuye.InterviewExperienceEntityMapper;
/**
 * 查询经验
 * @author 华少
 *
 */
@Controller
@RequestMapping("/")
public class QianTaiChaXunJingYan {
	@Autowired
	private InterviewExperienceEntityMapper interviewExperienceEntityMapper;
	@GetMapping({"chaxuijingyan" })
	public String select(Model model, HttpServletRequest request) {
		String type=request.getParameter("id");
		List<InterviewExperienceEntity> experience=null;
		if(type.equals("-1")) {
			experience =interviewExperienceEntityMapper.chaxun();
		}else {
			experience =interviewExperienceEntityMapper.leixingchaxun(type);
		}
		System.out.println("asasd:"+type);
		model.addAttribute("list",experience);
		return "qt-jy-cxjingyan";
	}
}
